import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "/",
    redirect: "/",
  },
  {
    path: "/home",
    name: "home",
    component: () => import("@/views/HomeView.vue"),
    children: [
      {
        path: '/home/chart-bar',
        name: 'chart-bar',
        component: () => import('@/views/Echarts/BarChart.vue')
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/LoginPage.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("@/views/login/RegisterPage.vue"),
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
